class Soccer {
    constructor(obj) {
        this.players = [];
        this.teams = [];
        this.games = [];

        this.fieldWidth = 400;
        this.fieldHeight = 180;

        this.ballX = 0;
        this.ballY = 0;

        this.language = obj.lang;

        this.word = {
            zh_old: {
                "红牌": "红牌",
                "黄牌": "黄牌",
                "主队": "主队",
                "客队": "客队",
                "控球": "控球",
                "进攻": "进攻",
                "危险进攻": "危险进攻",
                "球门球": "球门球",
                "任意球": "任意球",
                "界外球": "界外球",
                "角球": "角球",
                "正中靶心": "正中靶心",
                "射偏球门": "射偏球门",
                "射正球门": "射正球门",
                "全场结束": "全场结束",
                "半场": "半场",
                "主队受伤": "主队受伤",
                "客队受伤": "客队受伤",
                "主队更换替补": "主队更换替补",
                "客队更换替补": "客队更换替补",
                "伤停补时": "伤停补时",
            },
            en_old: {
                "红牌": "Red Card",
                "黄牌": "Yellow Card",
                "主队": "Home Team",
                "客队": "Away Team",
                "控球": "Possession",
                "进攻": "Attack",
                "危险进攻": "Dangerous Attack",
                "球门球": "Goal Kick",
                "任意球": "Free Kick",
                "界外球": "Throw-in",
                "角球": "Corner Kick",
                "正中靶心": "On Goal",
                "射偏球门": "Off Target",
                "射正球门": "On Target",
                "全场结束": "Full Time",
                "半场": "Half Time",
                "主队受伤": "Home Team Injury",
                "客队受伤": "Away Team Injury",
                "主队更换替补": "Home Team Substitution",
                "客队更换替补": "Away Team Substitution",
                "伤停补时": "Injury Time"
            },
            zh1: {
                "主队": "主队",
                "客队": "客队",
                "正中靶心": "正中靶心",
                "进球数": "进球数",
                "黄牌数": "黄牌数",
                "红牌数": "红牌数",

            },
            en1: {
                "主队": "Home Team",
                "客队": "Away Team",
                "正中靶心": "On Goal",
                "进球数": "Score",
                "黄牌数": "Yellow Card",
                "红牌数": "Red Card",
            },
            en: {
                "危险进攻": "Dangerous attack",
                "进攻": "Attack",
                "控球": "In possession",
                "进球": "Goal",
                "角球": "Corner",
                "黄牌": "Yellow card",
                "红牌": "Red card",
                "球门球": "Goal kick",
                "判点球给": "Penalty",
                "危险任意球": "Dangerous free kick",
                "任意球": "Free kick",
                "射中点球": "Shootout score",
                "射失点球": "Shootout miss",
                "点球": "Shootout to take",
                "射正球门": "Shot on target",
                "射偏球门": "Shot off target",
                "更换替补": "Substitution",
                "射失点球": "Penalty missed",
                "界外球": "Throw",
                "受伤": "Injury",
                "越位": "Offside",
                "可能进球": "Possible goal",
                "审查中": "In progress",
                "审查红牌": "Reviewing red card",
                "审查进球": "Reviewing goal",
                "审查点球": "Reviewing penalty",
                "可能红牌": "Possible red card",
                "可能进球": "Possible goal",
                "可能点球": "Possible penalty",
                "无红牌": "Check complete no red card",
                "进球无效": "Check complete no goal",
                "无点球": "Check complete no penalty",
                "上半场": "Kick off",
                "半场结束": "Half time",
                "下半场": "Second Half",
                "全场结束": "Full time",
                "加时赛上半场": "Start extra time 1",
                "加时赛半场结束": "Extra time half time",
                "加时赛下半场": "Start extra time 2",
                "加时赛结束": "End of extra time",
                "点球大战": "Penalty shootout",
                "伤停补时": "Injury time"
            },
            zh: {
                "危险进攻": "危险进攻",
                "进攻": "进攻",
                "控球": "控球",
                "进球": "进球",
                "角球": "角球",
                "黄牌": "黄牌",
                "红牌": "红牌",
                "球门球": "球门球",
                "判点球给": "判点球给",
                "危险任意球": "危险任意球",
                "任意球": "任意球",
                "射中点球": "射中点球",
                "射失点球": "射失点球",
                "点球": "点球",
                "射正球门": "射正球门",
                "射偏球门": "射偏球门",
                "更换替补": "更换替补",
                "射失点球": "射失点球",
                "界外球": "界外球",
                "受伤": "受伤",
                "越位": "越位",
                "可能进球": "可能进球",
                "审查中": "审查中",
                "审查红牌": "审查红牌",
                "审查进球": "审查进球",
                "审查点球": "审查点球",
                "可能红牌": "可能红牌",
                "可能进球": "可能进球",
                "可能点球": "可能点球",
                "无红牌": "无红牌",
                "进球无效": "进球无效",
                "无点球": "无点球",
                "上半场": "上半场",
                "半场结束": "半场结束",
                "下半场": "下半场",
                "全场结束": "全场结束",
                "加时赛上半场": "加时赛上半场",
                "加时赛半场结束": "加时赛半场结束",
                "加时赛下半场": "加时赛下半场",
                "加时赛结束": "加时赛结束",
                "点球大战": "点球大战",
                "伤停补时": "伤停补时",
            }
        }

        this.word.en = Object.assign({}, this.word.en1, this.word.en);
        this.word.zh = Object.assign({}, this.word.zh1, this.word.zh);

        this.lastData = {
            "PG": "",
            "VC": "",
            "XY": ""
        }

        this.passBallCount = 1;//连续传球次数

        this.playerName = '测试球员';
        this.playerNameEn = 'testplayer';
        this.delaySecond = 1; // 获取数据间隔延迟秒数
    }

    addWord(lang = 'zh', obj) {
        this.word[lang] = Object.assign({}, this.word[lang], obj);
    }

    random(min, max) {
        return Math.floor(Math.random() * (max - min + 1)) + min;
    }

    //清理屏幕 把上一个动画的元素隐藏
    clearScreen() {
        $('#ball').css({ 'opacity': 0 });
        $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
        $('.ml1-CommonAnimations_Line').css('opacity', 0);
        $('#playerName').css('opacity', 0);
        $('#ml1-Possession1').css('opacity', 0);
        $('#ml1-ShotBase').css('opacity', 0);
        $('#ml1-ThrowRadial').css('opacity', 0);

    }

    test() {
        console.log(anime);
        setTimeout(function () {
            soccer.attack0();
        }, 0);

        setTimeout(function () {
            soccer.attack1();
        }, 2000);

        setTimeout(function () {
            soccer.attack2();
        }, 4000);

        setTimeout(function () {
            soccer.goal();
        }, 6000);

        setTimeout(function () {
            soccer.clearScreen();
        }, 8000);
    }

    record(data = {
        "PG": "",
        "VC": "21002",
        "XY": "0.68,0.49"
    }) {
        //记录上一次的动作，如果是传球的话 需要连续绘制路径
        this.lastData = data;
    }

    position(data = {
        "PG": "",
        "VC": "21002",
        "XY": "0.68,0.49"
    }) {
        this.refresh();

        // $('#ballPosition').css('opacity', 1);
        anime({
            targets: '#ballPosition',
            opacity: 1,
            duration: 1000,
            easing: 'easeInOutQuad',
            left: data.XY.split(',')[0] * this.fieldWidth,
            top: data.XY.split(',')[1] * this.fieldHeight,
        })

    }

    redCard(team = 'home') {
        this.refresh();

        anime({
            targets: '.redcard',
            opacity: 1,
            duration: 1000,
            easing: 'easeInOutQuad',
        });

        if (team == 'home') {
            $('#playerName').css('opacity', 0);
            $('#playerName').css('text-align', 'center');
            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 1);
            $('.ml1-CommonAnimations_H2TextWrapper').css('width', '100%');
            $('.ml1-CommonAnimations_H2TextWrapper').css('left', '60');
            $('.ml1-CommonAnimations_H2TextWrapper').css('text-align', 'right');

            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: -60,
                easing: 'easeInQuad',
                duration: 500,
            });
        }

        if (team == 'away') {
            $('#playerName').css('opacity', 0);
            $('#playerName').css('text-align', 'center');
            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 1);
            $('.ml1-CommonAnimations_H2TextWrapper').css('width', '100%');
            $('.ml1-CommonAnimations_H2TextWrapper').css('left', '60');
            $('.ml1-CommonAnimations_H2TextWrapper').css('text-align', 'left');

            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: 60,
                easing: 'easeInQuad',
                duration: 500,
            });
        }


    }

    yellowCard(team = 'home') {
        this.refresh();

        anime({
            targets: '.yellowcard',
            opacity: 1,
            duration: 1000,
            easing: 'easeInOutQuad',
        });

        if (team == 'home') {
            $('#playerName').css('opacity', 0);
            $('#playerName').css('text-align', 'center');
            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 1);
            $('.ml1-CommonAnimations_H2TextWrapper').css('width', '100%');
            $('.ml1-CommonAnimations_H2TextWrapper').css('left', '60px');
            $('.ml1-CommonAnimations_H2TextWrapper').css('text-align', 'right');

            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: -60,
                easing: 'easeInQuad',
                duration: 500,
            });
        }

        if (team == 'away') {
            $('#playerName').css('opacity', 0);
            $('#playerName').css('text-align', 'center');
            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 1);
            $('.ml1-CommonAnimations_H2TextWrapper').css('width', '100%');
            $('.ml1-CommonAnimations_H2TextWrapper').css('right', '-60');
            $('.ml1-CommonAnimations_H2TextWrapper').css('text-align', 'left');

            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: 60,
                easing: 'easeInQuad',
                duration: 500,
            });
        }



    }


    move(data = {
        "PG": "",
        "VC": "1-Attack",
        "XY": "0.68,0.49"
    }) {
        console.log('nowdata',data);
        console.log('lastdata',this.lastData);
        function getRandomFloat(min, max) {
            return Math.random() * (max - min) + min;
        }
        if (['1-DangerousAttack', '1-Attack', '1-InPossession', '2-DangerousAttack', '2-Attack', '2-InPossession'].includes(data.VC)) {
            // 必须是连续传球的后续且是同一个队才会不清空屏幕保留轨迹绘制
            if (['1-DangerousAttack', '1-Attack', '1-InPossession', '2-DangerousAttack', '2-Attack', '2-InPossession'].includes(this.lastData.VC) &&
                data.VC[0] == this.lastData.VC[0]
            ) {

                this.passBallCount++;
                if (this.passBallCount > 10) {
                    return
                }
                if (this.passBallCount > 5) {
                    var removeIndex = this.passBallCount - 5;
                    var oldLine = document.querySelector('#animatedLine' + removeIndex);
                    if (oldLine) {
                        oldLine.style.opacity = 0;  // 隐藏
                    }
                }

                setTimeout(function () {
                    $('.moveLine').css('opacity', 1);
                }, 1);
                console.log('连续传球', this.passBallCount);

                var sx = ''
                var sy = ''
                var dx = ''
                var dy = ''

                sx = this.lastData.XY.split(',')[0];
                sy = this.lastData.XY.split(',')[1];

                dx = data.XY.split(',')[0];
                dy = data.XY.split(',')[1]

                // document.body.innerHTML += `<p>连续传球，${this.passBallCount} dx: ${dx}, dy: ${dy}, sx: ${sx}, sy: ${sy}</p>`;
                sx = parseInt(sx * this.fieldWidth);
                sy = parseInt(sy * this.fieldHeight);

                dx = parseInt(dx * this.fieldWidth);
                dy = parseInt(dy * this.fieldHeight);

                document.querySelector('#animatedLine' + this.passBallCount).setAttribute('x1', sx)
                document.querySelector('#animatedLine' + this.passBallCount).setAttribute('y1', sy)

                anime({
                    targets: '#animatedLine' + this.passBallCount,
                    x2: [sx, dx],
                    y2: [sy, dy],
                    duration: 2000,
                    opacity: 1,
                    easing: 'easeInOutQuad',
                });


                anime({
                    targets: '#ballPosition',
                    opacity: 1,
                    duration: 1,
                    easing: 'easeInOutQuad',
                    left: [sx-5, dx - 5],
                    top: [sy-5, dy - 5],
                    // left: [sx,data.XY.split(',')[0] * this.fieldWidth+2],
                    // top: [ sy,data.XY.split(',')[1] * this.fieldHeight+2],
                })


            }

            // 其余的包括上一个动作不是传球，或者上一个动作不是一个队的，都作为第一次传球处理
            else {
                console.log('第一脚传球');
                this.passBallCount = 1;

                dx = data.XY.split(',')[0];
                dy = data.XY.split(',')[1]

                setTimeout(function () {
                    $('.moveLine').css('opacity', 0);
                    for(var i=1;i<=10;i++){
                        document.querySelector('#animatedLine' + i).style.opacity = 0;  // 隐藏
                    }
                }, 1);

                anime({
                    targets: '#ballPosition',
                    opacity: 1,
                    duration: 1,
                    easing: 'easeInOutQuad',
                    left: dx * this.fieldWidth - 5,
                    top: dy * this.fieldHeight - 5,
                    // left: [sx,data.XY.split(',')[0] * this.fieldWidth+2],
                    // top: [ sy,data.XY.split(',')[1] * this.fieldHeight+2],
                })

                 
            }
        }else{
            this.passBallCount = 0;
            this.refresh();
        }
        this.record(data);

         

    }

    // 球门球
    goalKick(type = 1) {
        this.refresh();

        var x = ''
        var y = ''
        var r = '' // 旋转角度

        if (type == 1) {
            x = 0
            y = 90
            r = 0

            $('#playerName').css('opacity', 1);
            $('#playerName').css('text-align', 'center');

            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['球门球']);
            $('#playerName').text(this.word[this.language]['主队']);

        }

        if (type == 2) {
            x = 400
            y = 90
            r = 180

            $('#playerName').css('opacity', 1);
            $('#playerName').css('text-align', 'center');

            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['球门球']);
            $('#playerName').text(this.word[this.language]['客队']);

        }


        $('#ml1-WideKickRadial').css({ 'opacity': 1 });
        document.getElementById("ml1-WideKickRadial").style.transform = `translate(${x}px, ${y}px)  rotate(${r}deg)`

        $('#ball').css({ 'opacity': 1 });


        anime({
            targets: '#ball',
            left: x,
            top: y,
            easing: 'easeInOutSine',
            duration: 1,
        });

        anime({
            targets: '#ml-WideKickRadial',
            opacity: 1,
            easing: 'easeInOutSine',
            duration: 1,
        });

        anime.timeline({
            loop: true
        }).add({
            targets: ['#ml1-WideKickRadialOuter', '#ml1-WideKickRadialCentre', '#ml1-WideKickRadialInner'],
            scaleX: [0, 1],
            scaleY: [0, 1],
            duration: 1000,
            easing: 'linear'
        })

    }

    //任意球，动画开角42度
    freeKick(data = {
        "PG": "",
        "VC": "1-FreeKick",
        "XY": "0.68,0.49"
    }) {
        this.refresh();

        console.log('任意球');


        // 解析并转换坐标
        var [x, y] = data.XY.split(',').map(Number);
        x = x * this.fieldWidth;
        y = y * this.fieldHeight;

        var targetX, targetY;

        if (data.VC[0] == "1") {
            // 右边线中点
            targetX = this.fieldWidth;
            targetY = this.fieldHeight / 2;
        } else {
            // 左边线中点
            targetX = 0;
            targetY = this.fieldHeight / 2;
        }

        // 计算角度
        var dx = targetX - x;
        var dy = targetY - y;
        var r = Math.atan2(dy, dx) * (180 / Math.PI);

        // 统一角度范围为 0 - 360 度
        r = (r + 360) % 360;  // 旋转角度，从水平线顺时针计算角度，90就代表动画开角中间线朝下垂直于水平线，270或者-90就代表动画开角中间线朝上垂直于水平线


        if (data.VC === "1-FreeKick") {
            $('#playerName').css('opacity', 1);
            $('#playerName').css('text-align', 'center');

            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['任意球']);
            $('#playerName').text(this.word[this.language]['主队']);
        }

        if (data.VC === "2-FreeKick") {
            $('#playerName').css('opacity', 1);
            $('#playerName').css('text-align', 'center');

            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['任意球']);
            $('#playerName').text(this.word[this.language]['客队']);
        }

        if (data.VC === "1-DangerousFreeKick") {
            $('#playerName').css('opacity', 1);
            $('#playerName').css('text-align', 'center');

            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['危险任意球']);
            $('#playerName').text(this.word[this.language]['主队']);
        }

        if (data.VC === "2-DangerousFreeKick") {
            $('#playerName').css('opacity', 1);
            $('#playerName').css('text-align', 'center');

            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['危险任意球']);
            $('#playerName').text(this.word[this.language]['客队']);
        }

        $('#ml1-NarrowKickRadial').css({ 'opacity': 1 });
        document.getElementById("ml1-NarrowKickRadial").style.transform = `translate(${x}px, ${y}px)  rotate(${r}deg)`

        $('#ball').css({ 'opacity': 1 });


        anime({
            targets: '#ball',
            left: x,
            top: y,
            easing: 'easeInOutSine',
            duration: 1,
        });

        anime({
            targets: '#ml-NarrowKickRadial',
            opacity: 1,
            easing: 'easeInOutSine',
            duration: 1,
        });

        anime.timeline({
            loop: true
        }).add({
            targets: ['#ml1-NarrowKickRadialOuter', '#ml1-NarrowKickRadialCentre', '#ml1-NarrowKickRadialInner'],
            scaleX: [0, 1],
            scaleY: [0, 1],
            duration: 1000,
            easing: 'linear'
        })
    }


    //界外球，动画开角76度
    throw(data = {
        "PG": "",
        "VC": "1-Throw",
        "XY": "0.68,0.49"
    }) {
        this.refresh();

        console.log('界外球');

        // 解析并转换坐标
        var [x, y] = data.XY.split(',').map(Number);
        x = x * this.fieldWidth;
        y = y * this.fieldHeight;

        var targetX, targetY;

        if (data.VC[0] == "1") {
            // 右边线中点
            targetX = this.fieldWidth;
            targetY = this.fieldHeight / 2;
        } else {
            // 左边线中点
            targetX = 0;
            targetY = this.fieldHeight / 2;
        }

        // 计算角度
        var dx = targetX - x;
        var dy = targetY - y;
        var r = Math.atan2(dy, dx) * (180 / Math.PI);

        // 统一角度范围为 0 - 360 度
        r = (r + 360) % 360; // 旋转角度，从水平线顺时针计算角度，90就代表动画开角中间线朝下垂直于水平线，270或者-90就代表动画开角中间线朝上垂直于水平线


        if (data.VC[0] === "1") {
            $('#playerName').css('opacity', 1);
            $('#playerName').css('text-align', 'center');

            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['界外球']);
            $('#playerName').text(this.word[this.language]['主队']);
        }

        if (data.VC[0] === "2") {
            $('#playerName').css('opacity', 1);
            $('#playerName').css('text-align', 'center');

            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['界外球']);
            $('#playerName').text(this.word[this.language]['客队']);
        }


        $('#ml1-ThrowRadial').css({ 'opacity': 1 });
        document.getElementById("ml1-ThrowRadial").style.transform = `translate(${x}px, ${y}px)  rotate(${r}deg)`

        $('#ball').css({ 'opacity': 1 });


        anime({
            targets: '#ball',
            left: x,
            top: y,
            easing: 'easeInOutSine',
            duration: 1,
        });

        anime({
            targets: '#ml-ThrowRadial',
            opacity: 1,
            easing: 'easeInOutSine',
            duration: 1,
        });

        anime.timeline({
            loop: true
        }).add({
            targets: ['#ml1-ThrowRadialOuter', '#ml1-ThrowRadialInner'],
            scaleX: [0, 1],
            scaleY: [0, 1],
            duration: 1000,
            easing: 'linear'
        }).add({
            targets: ['#ml1-ThrowRadialOuter', '#ml1-ThrowRadialInner'],
            opacity: 0,
            duration: 1000,
            easing: 'linear'
        });
    }

    // 角球，动画开角40度
    corner(type = 1) {
        this.refresh();
        console.log('角球');

        var padding = 10;

        //12
        //34
        // 分为四个区域的界外球    
        var x = ''
        var y = ''
        var r = '' // 旋转角度，从水平线顺时针计算角度，90就代表动画开角中间线朝下垂直于水平线，270或者-90就代表动画开角中间线朝上垂直于水平线

        //主队上角球，球场右边朝下
        if (type == 1) {
            x = 400
            y = 0
            r = this.random(110, 110);
        }
        //主队下角球，球场右边朝上
        if (type == 2) {
            x = 400
            y = 180
            r = this.random(-110, -110);
        }
        //客队上角球，球场左边朝下
        if (type == 3) {
            x = 0
            y = 0
            r = this.random(70, 70);
        }
        //客队下角球，球场左边朝上
        if (type == 4) {
            x = 0
            y = 180
            r = this.random(-70, -70);
        }

        if (type == 1 || type == 2) {
            $('#playerName').css('opacity', 1);
            $('#playerName').css('text-align', 'center');

            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['角球']);
            $('#playerName').text(this.word[this.language]['主队']);
        }

        if (type == 3 || type == 4) {
            $('#playerName').css('opacity', 1);
            $('#playerName').css('text-align', 'center');

            $('#ballAction').css('opacity', 1);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['角球']);
            $('#playerName').text(this.word[this.language]['客队']);
        }

        $('#ml1-NarrowKickRadial').css({ 'opacity': 1 });
        document.getElementById("ml1-NarrowKickRadial").style.transform = `translate(${x}px, ${y}px)  rotate(${r}deg)`

        $('#ball').css({ 'opacity': 1 });


        anime({
            targets: '#ball',
            left: x,
            top: y,
            easing: 'easeInOutSine',
            duration: 1,
        });

        anime({
            targets: '#ml-NarrowKickRadial',
            opacity: 1,
            easing: 'easeInOutSine',
            duration: 1,
        });

        anime.timeline({
            loop: true
        }).add({
            targets: ['#ml1-NarrowKickRadialOuter', '#ml1-NarrowKickRadialCentre', '#ml1-NarrowKickRadialInner'],
            scaleX: [0, 1],
            scaleY: [0, 1],
            duration: 1000,
            easing: 'linear'
        })
    }

    //控球
    attack0(team = 'home') {
        this.refresh();
        console.log('attack0',team);

        $('#ml1-Possession1').css('opacity', 0);
        $('#ml1-Possession1-2').css('opacity', 0);

        anime({
            targets: '#ml1-Possession1',
            d: "M2,2 200,2 200,2 C200,1.4 200,28 200,28 C200,29 200,30 200,31 L200,61 L200,88 C200,89 200,90 200,91 L200,121 L200,146 C200,147 200,150 200,151 L200,178 C200,178 2.0,178 2.0,178 L2,2 Z",
            easing: 'easeInQuad',
            duration: 500,
        });

        if (team == 'home') {

            // $('.ml1-CommonAnimations_H1TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_Line').css('opacity', 0);

            // $('.ml1-CommonAnimations_H1TextWrapper').css('left', 72);
            // $('.ml1-CommonAnimations_H2TextWrapper').css('left', -95);
            // $('.ml1-CommonAnimations_Line').css('left', 257);


            // $('.ml1-Possession1').css('opacity', 1);
            $('#playerName').css('opacity', 1);
            $('#playerName').css('left', '-240px');
            $('#playerName').css('text-align', 'right');

            $('#ballAction').css('opacity', 1);
            $('#ballAction').css('left', '-240px');
            $('#ballAction').css('text-align', 'right');


            $('#ml1-Possession1').css('opacity', 1);

            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['控球']);
            $('#playerName').text(this.word[this.language]['主队']);


            anime({
                targets: ['#playerName'],
                opacity: [0, 1],
                left: [-250, -240],
                easing: 'easeInQuad',
                duration: 500,
            });


            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: [-250, -240],
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['.ml1-CommonAnimations_Line'],
                opacity: [0, 1],
                left: [160, 170],
                easing: 'easeInQuad',
                duration: 500,
            });
        }
        if (team == 'away') {

            // $('.ml1-CommonAnimations_H1TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_Line').css('opacity', 1);
            $('.ml1-CommonAnimations_Line').css('left', '370px');

            // $('.ml1-CommonAnimations_H1TextWrapper').css('left', 72);
            // $('.ml1-CommonAnimations_H2TextWrapper').css('left', -95);
            // $('.ml1-CommonAnimations_Line').css('left', 257);


            // $('.ml1-Possession1').css('opacity', 1);
            $('#playerName').css('opacity', 1);
            $('#playerName').css('left', '240px');

            $('#playerName').css('text-align', 'left');

            $('#ballAction').css('opacity', 1);
            $('#ballAction').css('left', '240px');
            $('#ballAction').css('text-align', 'left');


            $('#ml1-Possession1-2').css('opacity', 1);

            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['控球']);
            $('#playerName').text(this.word[this.language]['客队']);

            anime({
                targets: ['#playerName'],
                opacity: [0, 1],
                left: [250, 240],
                easing: 'easeInQuad',
                duration: 500,
            });


            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: [250, 240],
                easing: 'easeInQuad',
                duration: 500,
            });
            anime({
                targets: ['.ml1-CommonAnimations_Line'],
                opacity: [0, 1],
                left: [240, 230],
                easing: 'easeInQuad',
                duration: 500,
            });
        }
    }

    //普通进攻
    attack1(team = 'home') {
        console.log('attack1',team);

        this.refresh();

        if (team == 'home') {
            $('#playerName').css('opacity', 0);
            $('#ballAction').css('opacity', 0);

            $('#playerName').css('text-align', 'right');
            $('#ballAction').css('text-align', 'right');


            $('#ml1-Possession1').css('opacity', 0);
            $('#ml1-Possession1-2').css('opacity', 0);


            $('#playerName').css('opacity', 1);
            $('#ballAction').css('opacity', 1);
            $('#ml1-Possession1').css('opacity', 1);

            $('#playerName').text(this.word[this.language]['主队']);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['进攻']);

            anime({
                targets: '#ml1-Possession1',
                d: "M2,2 200,2 200,2 C200,1.4 200,28 200,28 C200,29 200,30 200,31 L200,61 L200,88 C200,89 200,90 200,91 L200,121 L200,146 C200,147 200,150 200,151 L200,178 C200,178 2.0,178 2.0,178 L2,2 Z",
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: '#ml1-Possession1',
                d: 'M2,2 267,2 267,2 C267,1.4 278.7,28 278.7,28 C279,29 279,30 278.7,31 L267,61 L278.7,88 C279,89 279,90 278.7,91 L267,121 L278.7,146 C279,147 279,150 278.7,151 L267,178 C267,178 2.0,178 2.0,178 L2,2 Z',
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['#playerName'],
                opacity: [0, 1],
                left: [-200, -180],
                easing: 'easeInQuad',
                duration: 500,
            });


            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: [-200, -180],
                easing: 'easeInQuad',
                duration: 500,
            });
            anime({
                targets: ['.ml1-CommonAnimations_Line'],
                opacity: [0, 1],
                left: [220, 230],
                easing: 'easeInQuad',
                duration: 500,
            });
        }

        if (team == 'away') {
            $('#playerName').css('opacity', 0);
            $('#ballAction').css('opacity', 0);

            $('#playerName').css('text-align', 'left');
            $('#ballAction').css('text-align', 'left');


            $('#ml1-Possession1').css('opacity', 0);
            $('#ml1-Possession1-2').css('opacity', 0);


            $('#playerName').css('opacity', 1);
            $('#ballAction').css('opacity', 1);

            $('#ml1-Possession1-2').css('opacity', 1);

            $('#playerName').text(this.word[this.language]['客队']);
            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['进攻']);


            // anime({
            //     targets: '#ml1-Possession1-2',
            //     // d: "M2,2 200,2 200,2 C200,1.4 200,28 200,28 C200,29 200,30 200,31 L200,61 L200,88 C200,89 200,90 200,91 L200,121 L200,146 C200,147 200,150 200,151 L200,178 C200,178 2.0,178 2.0,178 L2,2 Z",
            //     d: "M400,2 200,2 200,2 C200,1.4 200,28 200,28 C200,29 200,30 200,31 L200,61 L200,88 C200,89 200,90 200,91 L200,121 L200,146 C200,147 200,150 200,151 L200,178 C200,178 400,178 400,178 L400,2 Z",
            //     // d: "M200,2 400,2 400,2 C400,1.4 400,28 400,28 C400,29 400,30 400,31 L400,61 L400,88 C400,89 400,90 400,91 L400,121 L400,146 C400,147 400,150 400,151 L400,178 C400,178 200,178 200,178 L200,2 Z",
            //     easing: 'easeInQuad',
            //     duration: 500,
            // });

            anime({
                targets: '#ml1-Possession1-2',
                // d: 'M2,2 267,2 267,2 C267,1.4 278.7,28 278.7,28 C279,29 279,30 278.7,31 L267,61 L278.7,88 C279,89 279,90 278.7,91 L267,121 L278.7,146 C279,147 279,150 278.7,151 L267,178 C267,178 2.0,178 2.0,178 L2,2 Z',
                d: 'M 200,2 133,2 133,2 C133,1.4 122.7,28 122.7,28 C121,29 121,30 121.7,31 L133,61 L121.7,88 C121,89 121,90 121.7,91 L133,121 L121.7,146 C121,147 121,150 121.7,151 L133,178 C133,178 398,178 398,178 L398,2 200,2 Z',
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['#playerName'],
                opacity: [0, 1],
                left: [200, 180],
                easing: 'easeInQuad',
                duration: 500,
            });


            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: [200, 180],
                easing: 'easeInQuad',
                duration: 500,
            });
            anime({
                targets: ['.ml1-CommonAnimations_Line'],
                opacity: [0, 1],
                left: [180, 170],
                easing: 'easeInQuad',
                duration: 500,
            });
        }


    }

    //危险进攻
    attack2(team = 'home') {
        console.log('attack2',team);

        this.refresh();

        this.attack1(team);
        if (team == 'home') {


            $('#playerName').css('text-align', 'right');
            $('#ballAction').css('text-align', 'right');

            // $('.ml1-CommonAnimations_H1TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_Line').css('opacity', 0);

            // $('.ml1-CommonAnimations_H1TextWrapper').css('left', 72);
            $('.ml1-CommonAnimations_H2TextWrapper').css('left', 132);
            $('.ml1-CommonAnimations_Line').css('left', 317);

            // <stop class="gradStart" offset="43.8%" style="stop-opacity: 0.4; stop-color: rgb(24, 84, 53);"></stop>
            // <stop class="gradEnd" offset="100%" style="stop-opacity: 0.4; stop-color: rgb(79, 41, 26);"></stop>

            $('#ml1-Gradient1 .gradStart').attr('offset', '43.8%');
            $('#ml1-Gradient1 .gradStart').attr('style', 'stop-opacity: 0.4; stop-color: rgb(24, 84, 53);');

            $('#ml1-Gradient1 .gradEnd').attr('offset', '100%');
            $('#ml1-Gradient1 .gradEnd').attr('style', 'stop-opacity: 0.4; stop-color: rgb(79, 41, 26);');

            $('#playerName').text(this.word[this.language]['主队']);

            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['危险进攻']);

            // anime({
            //     targets: '#ml1-Possession1',
            //     d: "M2,2 200,2 200,2 C200,1.4 200,28 200,28 C200,29 200,30 200,31 L200,61 L200,88 C200,89 200,90 200,91 L200,121 L200,146 C200,147 200,150 200,151 L200,178 C200,178 2.0,178 2.0,178 L2,2 Z",
            //     easing: 'easeInQuad',
            //     duration: 500,
            // });

            // anime({
            //     targets: '#ml1-Possession1',
            //     d: 'M2,2 267,2 267,2 C267,1.4 278.7,28 278.7,28 C279,29 279,30 278.7,31 L267,61 L278.7,88 C279,89 279,90 278.7,91 L267,121 L278.7,146 C279,147 279,150 278.7,151 L267,178 C267,178 2.0,178 2.0,178 L2,2 Z',
            //     easing: 'easeInQuad',
            //     duration: 500,
            // });

            // anime({
            //     targets: '#ml1-Possession1',
            //     d: 'M2,2 79,2 79,2 C79,1.4 62,28 62,28 C62,29 62,30 62,31 L79,61 L62,88 C62,89 62,90 62,91 L79,121 L62,146 C62,147 62,150 62,151 L79,178 C79,178 2.0,178 2.0,178 L2,2 Z',
            //     easing: 'easeInQuad',
            //     duration: 500,
            //     // delay: 3000
            // });

            anime({
                targets: '#ml1-Possession1',
                d: 'M2,2 321.04462809917356,2 321.91239669421486,2 C321.91239669421486,1.4 338.40000000000003,28 338.40000000000003,28 C339.26776859504133,29 339.26776859504133,30 338.40000000000003,31 L321.91239669421486,61 L338.40000000000003,88 C339.26776859504133,89 339.26776859504133,90 338.40000000000003,91 L321.91239669421486,121 L338.40000000000003,146 C339.26776859504133,147 339.26776859504133,150 338.40000000000003,151 L321.91239669421486,178 C321.91239669421486,178 2.0,178 2.0,178 L2,2 Z',
                easing: 'easeInQuad',
                duration: 500,
                // delay: 3000
            });

            anime({
                targets: ['#playerName'],
                opacity: [0, 1],
                left: [-120, -100],
                easing: 'easeInQuad',
                duration: 500,
            });


            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: [-120, -100],
                easing: 'easeInQuad',
                duration: 500,
            });
            anime({
                targets: ['.ml1-CommonAnimations_Line'],
                opacity: [0, 1],
                left: [300, 310],
                easing: 'easeInQuad',
                duration: 500,
            });





        }

        if (team == 'away') {


            $('#playerName').css('text-align', 'left');
            $('#ballAction').css('text-align', 'left');

            // $('.ml1-CommonAnimations_H1TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_Line').css('opacity', 0);

            // $('.ml1-CommonAnimations_H1TextWrapper').css('left', 72);
            $('.ml1-CommonAnimations_H2TextWrapper').css('left', 132);
            $('.ml1-CommonAnimations_Line').css('left', 317);

            // <stop class="gradStart" offset="43.8%" style="stop-opacity: 0.4; stop-color: rgb(24, 84, 53);"></stop>
            // <stop class="gradEnd" offset="100%" style="stop-opacity: 0.4; stop-color: rgb(79, 41, 26);"></stop>

            $('#ml1-Gradient1 .gradStart').attr('offset', '0%');
            $('#ml1-Gradient1 .gradEnd').attr('style', 'stop-opacity: 0.4; stop-color: rgb(79, 41, 26);');


            $('#ml1-Gradient1 .gradEnd').attr('offset', '-20%');
            $('#ml1-Gradient1 .gradStart').attr('style', 'stop-opacity: 0.4; stop-color: rgb(24, 84, 53);');


            $('#playerName').text(this.word[this.language]['客队']);

            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['危险进攻']);

            // anime({
            //     targets: '#ml1-Possession1',
            //     d: "M2,2 200,2 200,2 C200,1.4 200,28 200,28 C200,29 200,30 200,31 L200,61 L200,88 C200,89 200,90 200,91 L200,121 L200,146 C200,147 200,150 200,151 L200,178 C200,178 2.0,178 2.0,178 L2,2 Z",
            //     easing: 'easeInQuad',
            //     duration: 500,
            // });

            // anime({
            //     targets: '#ml1-Possession1-2',
            //     // d: 'M2,2 267,2 267,2 C267,1.4 278.7,28 278.7,28 C279,29 279,30 278.7,31 L267,61 L278.7,88 C279,89 279,90 278.7,91 L267,121 L278.7,146 C279,147 279,150 278.7,151 L267,178 C267,178 2.0,178 2.0,178 L2,2 Z',
            //     d: 'M 200,2 133,2 133,2 C133,1.4 122.7,28 122.7,28 C121,29 121,30 121.7,31 L133,61 L121.7,88 C121,89 121,90 121.7,91 L133,121 L121.7,146 C121,147 121,150 121.7,151 L133,178 C133,178 398,178 398,178 L398,2 200,2 Z',
            //     easing: 'easeInQuad',
            //     duration: 500,
            // });

            anime({
                targets: '#ml1-Possession1-2',
                d: 'M398,2 79,2 79,2 C79,1.4 62,28 62,28 C62,29 62,30 62,31 L79,61 L62,88 C62,89 62,90 62,91 L79,121 L62,146 C62,147 62,150 62,151 L79,178 C79,178 398,178 398,178 L398,2 Z',
                easing: 'easeInQuad',
                duration: 500,
                // delay: 3000
            });

            anime({
                targets: ['#playerName'],
                opacity: [0, 1],
                left: [120, 100],
                easing: 'easeInQuad',
                duration: 500,
            });


            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: [120, 100],
                easing: 'easeInQuad',
                duration: 500,
            });
            anime({
                targets: ['.ml1-CommonAnimations_Line'],
                opacity: [0, 1],
                left: [100, 90],
                easing: 'easeInQuad',
                duration: 500,
            });





        }
    }

    // 进球
    goal(team = 'home') {
        this.refresh();

        $('#ml1-ShotBase').attr('style', 'display: none');
        $('#ml1-ShotBase_2').attr('style', 'display: none');

        if (team == 'home') {

            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_H2TextWrapper').css('width', '100%');
            $('.ml1-CommonAnimations_H2TextWrapper').css('left', '0');
            $('.ml1-CommonAnimations_H2TextWrapper').css('text-align', 'right');
            $('#ml1-ShotBase').attr('style', 'display: block');

            anime({
                targets: ['.ml1-ShotBase_ShotOffTarget'],
                left: [300, 345],
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: -60,
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['#ml1-Possession1-2'],
                opacity: [1, 0],
                // left: 72,
                easing: 'easeInQuad',
                duration: 500,
            });


            // $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['正中靶心']);
        }
        if (team == 'away') {

            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_H2TextWrapper').css('width', '100%');
            $('.ml1-CommonAnimations_H2TextWrapper').css('left', '0');
            $('.ml1-CommonAnimations_H2TextWrapper').css('text-align', 'left');
            $('#ml1-ShotBase_2').attr('style', 'display: block');

            anime({
                targets: ['.ml1-ShotBase_ShotOffTarget_2'],
                left: [100, 55],
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: 60,
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['#ml1-Possession1'],
                opacity: [1, 0],
                // left: 72,
                easing: 'easeInQuad',
                duration: 500,
            });

            // $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['正中靶心']);
        }
    }

    //射偏
    goal1(team = 'home') {
        this.refresh();

        $('#ml1-ShotBase').attr('style', 'display: none');
        $('#ml1-ShotBase_2').attr('style', 'display: none');

        if (team == 'home') {

            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_H2TextWrapper').css('width', '100%');
            $('.ml1-CommonAnimations_H2TextWrapper').css('left', '0');
            $('.ml1-CommonAnimations_H2TextWrapper').css('text-align', 'center');
            $('#ml1-ShotBase').attr('style', 'display: block');

            anime({
                targets: ['.ml1-ShotBase_ShotOffTarget'],
                left: [300, 345],
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: 100,
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['#ml1-Possession1-2'],
                opacity: [1, 0],
                // left: 72,
                easing: 'easeInQuad',
                duration: 500,
            });

            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['射偏球门']);
        }
        if (team == 'away') {

            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_H2TextWrapper').css('width', '100%');
            $('.ml1-CommonAnimations_H2TextWrapper').css('left', '0');
            $('.ml1-CommonAnimations_H2TextWrapper').css('text-align', 'center');
            $('#ml1-ShotBase_2').attr('style', 'display: block');

            anime({
                targets: ['.ml1-ShotBase_ShotOffTarget_2'],
                left: [100, 55],
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: -100,
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['#ml1-Possession1'],
                opacity: [1, 0],
                // left: 72,
                easing: 'easeInQuad',
                duration: 500,
            });

            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['射偏球门']);
        }
    }

    //射正
    goal2(team = 'home') {
        this.refresh();

        $('#ml1-ShotBase').attr('style', 'display: none');
        $('#ml1-ShotBase_2').attr('style', 'display: none');

        if (team == 'home') {



            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_H2TextWrapper').css('width', '100%');
            $('.ml1-CommonAnimations_H2TextWrapper').css('left', '0');
            $('.ml1-CommonAnimations_H2TextWrapper').css('text-align', 'center');
            $('#ml1-ShotBase').attr('style', 'display: block');

            anime({
                targets: ['.ml1-ShotBase_ShotOffTarget'],
                left: [300, 345],
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: 100,
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['#ml1-Possession1-2'],
                opacity: [1, 0],
                // left: 72,
                easing: 'easeInQuad',
                duration: 500,
            });

            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['射正球门']);
        }
        if (team == 'away') {

            $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
            $('.ml1-CommonAnimations_H2TextWrapper').css('width', '100%');
            $('.ml1-CommonAnimations_H2TextWrapper').css('left', '0');
            $('.ml1-CommonAnimations_H2TextWrapper').css('text-align', 'center');
            $('#ml1-ShotBase_2').attr('style', 'display: block');

            anime({
                targets: ['.ml1-ShotBase_ShotOffTarget_2'],
                left: [100, 55],
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['.ml1-CommonAnimations_H2TextWrapper'],
                opacity: [0, 1],
                left: -100,
                easing: 'easeInQuad',
                duration: 500,
            });

            anime({
                targets: ['#ml1-Possession1'],
                opacity: [1, 0],
                // left: 72,
                easing: 'easeInQuad',
                duration: 500,
            });

            $('.ml1-CommonAnimations_H2Text').text(this.word[this.language]['射正球门']);
        }
    }

    //动画暂停 显示状态
    status(textArr) {
        var that = this

        if (typeof textArr == 'string') {
            textArr = [textArr];
        }
        // 如果存在第二个判点球动作，就在 textArr 里添加这个动作
        if (this.secTeamVC) {
            if (secTeamVC[0] === "1") {
                textArr.push("判点球给主队");
            } else {
                textArr.push("判点球给客队");
            }
        }
        //处理多个元素的文本翻译
        for (var i = 0; i < textArr.length; i++) {
            textArr[i] = that.word[that.language][textArr[i]] || textArr[i];
        }

        console.log(textArr);

        var text = textArr.join(' ');

        // text = this.word[this.language][text];

        this.refresh();

        clearInterval(countdownInterval);
        $('.ml1-SoccerClock_Clock').text('00:00');

        // $('.ml1-CommonAnimations_H1TextWrapper').css('opacity', 0);
        // $('.ml1-CommonAnimations_H2TextWrapper').css('opacity', 0);
        // $('.ml1-CommonAnimations_Line').css('opacity', 0);
        // $('#ml1-ShotBase').attr('style', 'display: none');

        $('.ml1-CommonAnimations_H2Text').text(text);
        $('.ml1-CommonAnimations_H2TextWrapper').attr('style',
            'opacity: 1; display: block; text-align: center; left: 0px; top: 79px; width: 100%;');

    }

    refresh() {

        $('.ml1-CommonAnimations_H2TextWrapper').attr('style',
            'opacity: 1; display: block; text-align: center; left: 0px; top: 88px; width: 100%;');


        $('#ballPosition').css('opacity', 0);
        $('#ml1-Possession1').css('opacity', 0);
        $('#ml1-Possession1-2').css('opacity', 0);
        $('#playerName').css('opacity', 0);
        $('#playerName').css('left', 0);
        $('#ballAction').css('opacity', 0);
        $('.ml1-CommonAnimations_Line').css('opacity', 0);
        $('.moveLine').css('opacity', 0);

        $('#ml1-WideKickRadial').css('opacity', 0);
        $('#ml1-NarrowKickRadial').css('opacity', 0);
        $('#ml1-ThrowRadial').css('opacity', 0);

        $('#ball').css('opacity', 0);

        $('.redcard').css('opacity', 0);
        $('.yellowcard').css('opacity', 0);

        $('#ml1-ShotBase').attr('style', 'display: none');
        $('#ml1-ShotBase_2').attr('style', 'display: none');




    }
}